<template>
  <el-config-provider :locale="store.getters.language === 'zh' ? zhCn : en">
    <router-view />
  </el-config-provider>
</template>

<script>
export default {
  name: 'App'
}
</script>
<script setup>
import { useStore } from 'vuex'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/lib/locale/lang/en'
import { generateNewStyle, writeNewStyle } from '@/utils/theme'
const store = useStore()

// 页面刷新时，写入之前修改过的主题色
generateNewStyle(store.getters.mainColor).then((newStyleText) => {
  writeNewStyle(newStyleText)
})
</script>
<style lang="scss"></style>
